package com.fruitshop.dto;

import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 购物车数据传输对象
 */
@Data
public class CartDTO implements Serializable {
    
    private static final long serialVersionUID = 1L;
    
    /**
     * 水果ID
     */
    @NotNull(message = "水果ID不能为空")
    private Long fruitId;
    
    /**
     * 数量
     */
    @NotNull(message = "数量不能为空")
    @Min(value = 1, message = "数量最小为1")
    private Integer quantity;
    
    /**
     * 是否选中: 0-未选中, 1-已选中
     */
    private Integer selected = 1;
} 